<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/fmt" prefix="fmt"%>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>学生信息列表</title>
<link rel="stylesheet" href="css/style.css" />
<script language="javascript" src="js/tool.js"></script>
</head>

<body>
<div class="top">
	<p>学生信息列表</p>
</div>
<div class="check">
	<form action="StudentList" method="post">
        查询：
        <input id="keyword" name="keyword" value="${requestScope.keyword}" type="text" />
        <button type="submit">查 询</button>
        <button type="button" onclick="window.location.href='studentadd.jsp'">新 增</button>
    </form>
</div>
<div class="list">
	<table align="center" bordercolor="#CCCCCC" border="1" cellpadding="12" cellspacing="0">
		<tr>
			<td>序号</td>
			<td>学号</td>
			<td>姓名</td>
			<td>密码</td>
			<td>邮箱</td>
			<td>入学时间</td>
			<td>性别</td>
			<td>头像</td>
			<td>生日</td>
			<td>学历</td>
			<td>状态</td>
			<td width="100">编辑</td>
			<td width="100">删除</td>
		</tr>
        <c:if test="${empty requestScope.itemList}">
			<tr>
				<td colspan="13">暂无数据</td>
			</tr>
		</c:if>
        <c:if test="${!empty requestScope.itemList}">
        	<c:forEach items="${requestScope.itemList}" var="itemList" varStatus="id">
                <tr>
                    <td>${(nowPage-1)*(pageSize)+id.count}</td>
                    <td>${itemList.no}</td>
                    <td>${itemList.name}</td>
                    <td>${itemList.pwd}</td>
                    <td>${itemList.email}</td>
                    <td>
                    	<fmt:formatDate value="${itemList.entranceTime}" pattern="yyyy年MM月dd日" />
                    </td>
                    <td>${itemList.sex}</td>
                    <td>
                    	<img  src="${itemList.photo}" width="80px" height="80px"/>
                    </td>
                    <td>
                    	<fmt:formatDate value="${itemList.birth}" pattern="yyyy年MM月dd日" />
                    </td>
                    <td>${itemList.education}</td>
                    <td>${itemList.status}</td>
                    <td><a href="StudentEdit?id=${itemList.id}">编辑</a></td>
                    <td><a href="javascript:del(${itemList.id})">删除</a></td>
                </tr>
            </c:forEach>
        </c:if>
        <tr>
        	<td colspan="13">
                <form id="Jump" action="StudentList" method="post">
					<input type="hidden" name="nowPage" id="nowPage" value="${requestScope.nowPage}" />
				</form>
                共有[${requestScope.recordCount}]条消息，
                共[${requestScope.maxPage}]页，
                [${requestScope.pageSize}条/页]，
                当前第[${requestScope.nowPage}]页
                <br /><br />
                <a href="javascript:gotoPage('1')">首页</a>
                <c:if test="${requestScope.nowPage>1}">
                    <a href="javascript:gotoPage('${requestScope.nowPage-1}')">上一页</a>
                </c:if>
                <c:if test="${requestScope.nowPage<requestScope.maxPage}">
                    <a href="javascript:gotoPage('${requestScope.nowPage+1}')">下一页</a>
                </c:if>
                <a href="javascript:gotoPage('${requestScope.maxPage}')">尾页</a>
                &nbsp;&nbsp;&nbsp;&nbsp;
                跳转到
                <select class="selectPage" onchange="gotoPage(this.value)">
                    <c:forEach begin="1" end="${requestScope.maxPage}" var="page">
                        <c:if test="${page==requestScope.nowPage}">
                            <option value="${page}" selected="selected">${page}</option>
                        </c:if>
                        <c:if test="${page!=requestScope.nowPage}">
                            <option value="${page}">${page}</option>
                        </c:if>
                    </c:forEach>
                </select>
                页
            </td>
        </tr>
    </table>
</div>
</body>
</html>